<template>
  <div>
    <div>
      <p>我叫{{name}},性别:{{sex}},身高:{{height}},体重:{{weight}}</p>
      <p>我的年龄是:{{age}}岁</p>
      <br>
      <button @click="addAge">触发一秒长一岁</button>
    </div>
  </div>
</template>

<script>
export default {
  data () {
    return {}
  },
  mounted () {
    this.$store.commit('getTitle', '123')
  },
  computed: {
    name () {
      return this.$store.state.name
    },
    sex () {
      return this.$store.state.sex
    },
    height () {
      return this.$store.getters.getHeight
    },
    weight () {
      return this.$store.getters.getWeight
    },
    age () {
      return this.$store.state.age
    }
  },
  methods: {
    addAge () {
      this.$store.dispatch('setAge')
    }

  }
}
</script>

<style scope lang='stylus'>
  .home-wrapper
    width: 500px
    height: 300px
    margin: 0 auto
</style>
